package com.example.tourism.listenners;

import com.example.tourism.mapper.OrderMapper;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class messageStatus {

    @Autowired
    private OrderMapper  orderMapper;

    @RabbitListener(queues = "dlx.queue")
    public void listenDlxQueue(String orderUid) {
        // 得到订单的编号，根据订单编号进行判断是否缴费
        // 处理过时订单
        orderMapper.updateStatus(orderUid);
        System.out.println("处理延迟消息,订单uid："+orderUid);
    }
}
